<!doctype html>
<title>For loop</title>

<script>

var closet = [];

closet[0] = "hat";
closet[1] = "umbrella";
closet[2] = "katana";

//View the entire array 

for(var i = 0; i < closet.length; i++)
{
  console.log("Element " + i + ": " + closet[i]);
}

</script>